package com.example.board_jojo;

import android.app.Activity;
import android.content.Intent;
import android.view.MenuItem;

public class MainOptionMenu {
	public MainOptionMenu(Activity activity, MenuItem item){
		int id = item.getItemId();
		Intent intent = null;
		switch (id) {
		case R.id.input:
			intent = new Intent(activity, InputActivity.class);
			intent.setFlags(intent.FLAG_ACTIVITY_SINGLE_TOP);
			activity.startActivity(intent);
			break;

		case R.id.modify:
			intent = new Intent(activity, ModifyActivity.class);
			intent.setFlags(intent.FLAG_ACTIVITY_SINGLE_TOP);
			activity.startActivity(intent);
			break;

		case R.id.delete:
			intent = new Intent(activity, DeleteActivity.class);
			intent.setFlags(intent.FLAG_ACTIVITY_SINGLE_TOP);
			activity.startActivity(intent);
			break;

		case R.id.view:
			intent = new Intent(activity, ViewActivityk.class);
			intent.setFlags(intent.FLAG_ACTIVITY_SINGLE_TOP);
			activity.startActivity(intent);
			break;

		case R.id.main:
			intent = new Intent(activity, MainActivity.class);
			intent.setFlags(intent.FLAG_ACTIVITY_SINGLE_TOP);
			activity.startActivity(intent);
			break;

		}
	}
}
